By: zwellIt seems that SQL injection is a common practice. In fact, it is not the case. During the development of Pangolin, I have encountered too many special cases and continue to use in-depth injection methods. Here we will talk about the
If it does not exist, insert the new data
$sql = "INSERT into {$ecs->table (' Cat_lang ')} (CAT_ID,LANG_ID,CAT_NAME,KEYWORDS,CAT_DESC)
VALUES ({$cat _id},{$k}, ' {$val [' cat_name ']} ', ' {$val [' keywords ']} ', ' {$val [' Cat_desc ']} '} ')
On
Insert when the MySQL record does not exist In MySQL, inserting a record is very simple, but in some special applications, before inserting a record, you need to check whether the record already exists. The insert operation is performed only when
In MySQL, inserting (insert) A record is simple, but some special applications, before inserting a record, need to check whether the record already exists, only if the record does not exist to perform the insert operation, this article describes the
In MySQL, inserting (insert) A record is simple, but some special applications, before inserting a record, need to check whether the record already exists, only if the record does not exist to perform the insert operation, this article describes the
PrefaceWhen we do a lot of systems, we may have the need to:Only one picture is maintained in the CMS, and this image needs to be displayed in many parts of the site, and the size of the display is different.The general practice is to use this image
// If no data exists, insert new data
$ SQL = "INSERT INTO {$ ecs-> table ('cat _ lang ')} (cat_id, lang_id, cat_name, keywords, cat_desc)
VALUES ({$ cat_id}, {$ k}, '{$ val ['cat _ name']}', '{$ val ['keyword']}', '{$ val ['cat _ desc']}')
On
// If no data exists, insert new data$ SQL = "insert into {$ ECs-> table ('cat _ Lang ')} (cat_id, lang_id, cat_name, keywords, cat_desc)Values ({$ cat_id}, {$ k}, '{$ Val ['cat _ name']}', '{$ Val ['keyword']}', '{$ Val ['cat _ desc']}')On
Insert when the mysql record does not existIn MySQL, inserting a record is very simple, but in some special applications, before inserting a record, you need to check whether the record already exists. The insert operation is performed only when the
Insert when MySQL record does not existIn MySQL, inserting (insert) A record is very simple, but some special applications, before inserting the record, need to check whether this record already exists, only if the record does not exist, the insert
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.